]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
NetworkMenu: don't queue menu updates for destroyed devices
authorGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 3 Oct 2012 21:38:35 +0000 (23:38 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 19 Jan 2013 02:07:03 +0000 (03:07 +0100)
It will cause an exception as the work ID is now invalid, and may block
new devices from appearing for example when NM is restarted.

https://bugzilla.gnome.org/show_bug.cgi?id=684279

js/ui/status/network.js

index 71e3a735bc8209983b2b9d7d083d2b6d39901c38..4bc2335a092ab890f52361d9830b155bc4468678 100644 (file)
@@ -357,6 +357,12 @@ const NMDevice = new Lang.Class({
             this._firmwareChangedId = 0;
         }
 
+        if (this._deferredWorkId) {
+            // Just clear out, the actual removal is handled when the
+            // actor is destroyed
+            this._deferredWorkId = 0;
+        }
+
         this._clearSection();
         if (this.statusItem)
             this.statusItem.destroy();
@@ -490,8 +496,10 @@ const NMDevice = new Lang.Class({
     },
 
     _queueCreateSection: function() {
-        this._clearSection();
-        Main.queueDeferredWork(this._deferredWorkId);
+        if (this._deferredWorkId) {
+            this._clearSection();
+            Main.queueDeferredWork(this._deferredWorkId);
+        }
     },
 
     _clearSection: function() {